package com.qfedu.openplateform.gateway.config;



import com.qfedu.openplateform.gateway.filter.*;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

@Component
public class FilterConfig extends WebMvcConfigurerAdapter {

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        // 日志
        registry.addInterceptor(new LogFilter()).addPathPatterns("/**");
//        // 签名
//        registry.addInterceptor(new SignFilter()).addPathPatterns("/**");
//        // 增加 token 过滤器 排除拦截/login 路径   ， TokenFilter() 并没有加入到容器中
//        registry.addInterceptor(new TokenFilter()).addPathPatterns("/**").excludePathPatterns("/login");
//        // 时间
//        registry.addInterceptor(new TimerFilter()).addPathPatterns("/**");
//        // 系统参数
//        registry.addInterceptor(new SystemParamFilter()).addPathPatterns("/**").excludePathPatterns("/login");
//        // 幂等
//        registry.addInterceptor(new IdempotentFilter()).addPathPatterns("/**");
    }
}
